projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
904550d
)
* Fix memory leak when native compiled function is collected
author
Andrea Corallo
<akrl@sdf.org>
Thu, 11 Jun 2020 21:24:00 +0000
(23:24 +0200)
committer
Andrea Corallo
<akrl@sdf.org>
Thu, 11 Jun 2020 16:37:40 +0000
(18:37 +0200)
* src/alloc.c (cleanup_vector): Handle native compiled
functions.
src/alloc.c
patch
|
blob
|
history
diff --git
a/src/alloc.c
b/src/alloc.c
index 9a9dbb52e7b333a4a2d974e78686a94ed41e5050..750ffbd2dd8251146d4716e437ab7dc96cdda645 100644
(file)
--- a/
src/alloc.c
+++ b/
src/alloc.c
@@
-3156,6
+3156,17
@@
cleanup_vector (struct Lisp_Vector *vector)
PSEUDOVEC_STRUCT (vector, Lisp_Native_Comp_Unit);
dispose_comp_unit (cu, true);
}
+ else if (NATIVE_COMP_FLAG
+ && PSEUDOVECTOR_TYPEP (&vector->header, PVEC_SUBR))
+ {
+ struct Lisp_Subr *subr =
+ PSEUDOVEC_STRUCT (vector, Lisp_Subr);
+ if (subr->native_comp_u[0])
+ {
+ xfree (subr->symbol_name);
+ xfree (subr->native_c_name[0]);
+ }
+ }
}
/* Reclaim space used by unmarked vectors. */